package view;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;

import business.Pesquisar;

import com.cloudgarden.layout.AnchorConstraint;
import com.cloudgarden.layout.AnchorLayout;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JTextField;

import javax.swing.WindowConstants;
import javax.swing.border.BevelBorder;
import javax.swing.border.SoftBevelBorder;
import javax.swing.SwingUtilities;


/**oioioioioio
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class PesquisarCurso extends javax.swing.JFrame {
	private JLabel jLblNome;
	private JTextField jTxtfldCurso;
	private JButton jBtnPesquisar;
	private JButton jBtnCancelar;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				PesquisarCurso inst = new PesquisarCurso();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public PesquisarCurso() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			AnchorLayout thisLayout = new AnchorLayout();
			getContentPane().setLayout(thisLayout);
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			this.setTitle("Pesquisar Curso");
			this.setName("PesquisarCurso");
			getContentPane().setForeground(new java.awt.Color(192,192,192));
			this.setIconImage(new ImageIcon(getClass().getClassLoader().getResource("file/pesquisa2.png")).getImage());
			{
				jBtnCancelar = new JButton();
				getContentPane().add(jBtnCancelar, new AnchorConstraint(620, 798, 940, 694, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
				jBtnCancelar.setPreferredSize(new java.awt.Dimension(41, 40));
				jBtnCancelar.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
				jBtnCancelar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("file/cancelar.jpg")));

				jBtnCancelar.addActionListener(new  ActionListener(){

					@Override
					public void actionPerformed(ActionEvent e) {
						dispose();
						
					}
					
					
					
				});
			}
			{
				jBtnPesquisar = new JButton();
				getContentPane().add(jBtnPesquisar, new AnchorConstraint(612, 950, 940, 841, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
				jBtnPesquisar.setPreferredSize(new java.awt.Dimension(43, 41));
				jBtnPesquisar.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
				jBtnPesquisar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("file/pesquisar.gif")));

				jBtnPesquisar.addActionListener(new ActionListener() {
					
			String pesquisarNomeCurso;
					@Override
					public void actionPerformed(ActionEvent e) {
						
					pesquisarNomeCurso = jTxtfldCurso.getText();
					Pesquisar pesquisaCurso= new Pesquisar();
					pesquisaCurso.pesquisarCurso(pesquisarNomeCurso);
					}
				});
				
					
				
				
				
				
				
				
				
				
				
			}
			{
				jTxtfldCurso = new JTextField();
				getContentPane().add(jTxtfldCurso, new AnchorConstraint(92, 664, 268, 259, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
				jTxtfldCurso.setPreferredSize(new java.awt.Dimension(160, 22));
				jTxtfldCurso.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
			}
			{
				jLblNome = new JLabel();
				getContentPane().add(jLblNome, new AnchorConstraint(100, 259, 252, 16, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
				jLblNome.setText("Nome do Curso:");
				jLblNome.setPreferredSize(new java.awt.Dimension(96, 19));
			}
			pack();
			this.setSize(411, 163);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}

}
